{template 'common/header'}
<form action="{php echo $this->createWebUrl('gamesetting',array('ha'=>'update','id'=>$id))}" method="post" class="form-horizontal form" id="setting-form">
    <div class="panel panel-default">
			<div class="panel-heading">游戏参数设置</div>
			<div class="panel-body">
				<div class="tab-content">
					<div class="tab-pane  active" style="padding:20px;">

                          <div class="form-group">
                                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">是否上架：</label>
                                    <div class="col-xs-12 col-sm-9">
                                       <label class="checkbox-inline">
                                          <input type="radio" name="groundingornot" value="0" {if $list[status]==0}checked="checked"{/if}> 下架
                                       </label>
                                       <label class="checkbox-inline">
                                          <input type="radio" name="groundingornot" value="1" {if $list[status]==1}checked="checked"{/if}> 上架
                                       </label>                     
                                        <span class="help-block" style="color:#ff0000"></span>
                                    </div>
                          </div>  
                          <div class="form-group">
                          	 <label class="col-xs-12 col-sm-3 col-md-2 control-label">推荐：</label>
                                <div class="input-group">
                                    <div class="col-xs-12 col-sm-9">
                                     	<label class="checkbox-inline">

											    <input type="checkbox" name="recommend" value="1" {if $list[recommend] == 1}checked="checked"{/if}>&nbsp
                                     	</label>
                             		</div>
                                </div>
                                
                           </div>
                          <div class="form-group">
                                <div class="input-group">
                                    <span class="input-group-addon">所属分类：</span>
                             
                             		<select class="form-control" name="itemtype">
                             			<option></option>
                             			{loop $typelist $key $index}
                             			<option value="{$index['id']}" {if $list[typeid] == $index['id']}selected="selected"{/if}>{$index['itemtypename']}</option>
                             			{/loop}
                             		</select>
                                </div>
                                
                           </div>
                          <div class="form-group">
                                <div class="input-group">
                                    <span class="input-group-addon">游戏项目名称：</span>
                             
                                    <input type="text" name="itemname" placeholder="添加活动的标志" class="form-control" value="{$list[itemname]}">
                                </div>
                                
                           </div>
                          <div class="form-group">
                                <div class="input-group">
                                    <span class="input-group-addon">排序：</span>
                             
                                    <input type="text" name="ordernumber" class="form-control" value="{$list[ordernum]}">
                                </div>
                                
                           </div>
                          <div class="form-group">
                                <div class="input-group">
                                    <span class="input-group-addon">参与人数：</span>
                             
                                    <input type="text" name="joinnum" class="form-control" value="{$list[joinnum]}">
                                </div>
                                
                           </div>
                          <div class="form-group">
                                <div class="input-group">
                                    <span class="input-group-addon">单局游戏时间：（单位：秒）</span>
                             
                                    <input type="text" name="gamebetweentime" class="form-control" value="{$list[gametime]}">
                                </div>
       
                           </div>
                          <div class="form-group">
                                <div class="input-group">
                                    <span class="input-group-addon">游戏描述：</span>
                             
                                    <input type="text" name="gamemessage" class="form-control" value="{$list[gamemessage]}">
                                </div>
                                
                           </div>

                          <div class="form-group">
                                <div class="input-group">
                                    <span class="input-group-addon">游戏玩一次消耗积分：</span>
                             
                                    <input type="text" name="onetimepay" value="{$list[onetimepay]}" class="form-control">
                                </div>
                                
                           </div>
                           
                          <div class="form-group">
                                <div class="input-group">
                                    <span class="input-group-addon">游戏背景：：(640*960铺满屏幕)</span>
                             
                                     {php echo tpl_form_field_image('gamebgimgurl',$list[gamebgimgurl]);}
                                </div>
                                
                           </div>
                          <div class="form-group">
                                <div class="input-group">
                                   <span class="input-group-addon">全局帧数速度：</span>
                                    <input type="text" name="framenumber"   class="form-control" value="{$list[frameskip]}">
                                </div>
                                <span class="help-block">建议设置30</span>
                           </div>
                          <div class="form-group">
                                <div class="input-group">
                                   <span class="input-group-addon">鱼震动速率：</span>
                                    <input type="text" name="shocklvbegin"   class="form-control" value="{$list[bigestfishjoltingrate]}">
                                    <span class="input-group-addon">到</span> 
                                    <input type="text" name="shocklvend"   class="form-control" value="{$list[smallestfishjoltingrate]}">
                                </div>
                                <span class="help-block">概率为：建议设置在0.02到0.03之间</span>
                           </div>
                          <div class="form-group">
                                <div class="input-group">
                                    <span class="input-group-addon">鱼速度：</span>
                                    <input type="text" name="fishspeed"  class="form-control" value="{$list[fishspeed]}">
                                </div>
                                <span class="help-block">概率为：建议设置10000,值越小越快</span>
                           </div>
                          <div class="form-group">
                                <div class="input-group">
                                   <span class="input-group-addon">鱼上下游动幅度：(单位px)</span>
                                    <input type="text" name="updownrangebegin"   class="form-control" value="{$list[smallestestfishupanddownamplitude]}">
                                    <span class="input-group-addon">到</span> 
                                    <input type="text" name="updownrangeend"   class="form-control" value="{$list[bigestfishupanddownamplitude]}">
                                </div>
                                <span class="help-block">建议设置在30到50之间</span>
                           </div>
                          <div class="form-group">
                                <div class="input-group">
                                    <span class="input-group-addon">鱼游动高度范围：(单位:px)</span>
                                    <input type="text" name="swimtopest" class="form-control" value="{$list[heightestfishswimheight]}"/>
                                    <span class="input-group-addon">到</span> 
                                    <input type="text" name="swimlowest" class="form-control" value="{$list[lowestfishswimheight]}">
                                </div>
                                <span class="help-block">距离手机顶部距离,建议设置在400到500之间</span>
                           </div>
                          <div class="form-group">
                                <div class="input-group">
                                    <span class="input-group-addon">鱼密度：</span>
                                    <input type="text" value="{$list[fishdencity]}" name="fishdencity"  class="form-control">
                                </div>
                                <span class="help-block">建议设置1000,值越小密度越大</span>
                           </div>
                      <!---->
					</div>
				</div>
			</div>
		</div>
		<div class="panel panel-default">
			<div class="panel-heading">鱼图片设置</div>
			<div class="panel-body">
				<div class="tab-content">
					<div class="tab-pane  active" id="tab_basic">
					{loop $fisharray $index $value}
						<div class="itemcontainer">
                          <div class="form-group"  style="margin-top:80px;">
                             	<label for="inputPassword3" class="col-sm-2 control-label">名称</label>
                             	<div class="col-sm-10">
                                	<input type="text" name="fishname[]" class="form-control" value="{$value['fishname']}">
                                </div>
                           </div>
                      
                        <div class="form-group">
                            <label for="inputPassword3" class="col-sm-2 control-label">图片</label>
                            <div class="col-sm-10">
								{php echo tpl_form_field_image('fishimgurl[]',$value['fishimgurl']);}
								<span class="help-block">建议上传图片分辨率在240*30到480*84之间</span>
                            </div>
                            
                          </div>
                          

                          <div class="form-group">
                             	<label for="inputPassword3" class="col-sm-2 control-label">捕获积分倍数范围（如：0.2-2.0）</label>
                             	<div class="col-sm-10">
                                	<input type="text" name="fishchance[]" class="form-control" value="{$value['fishchance']}">
                                </div>
                           </div>
                         

                          <div class="form-group">
                             	<label for="inputPassword3" class="col-sm-2 control-label">捕获积分</label>
                             	<div class="col-sm-10">
                                	<input type="text" name="fishpoint[]" class="form-control" value="{$value['fishpoint']}">
                                </div>
                           </div>
                           <div class="form-group">
                           <label for="inputPassword3" class="col-sm-2 control-label"></label>
                             	<div class="col-sm-10">
                           			<button  type="button" id="deleteitembutton{$index}" class="deleteitembutton btn btn-primary">删除</button>
                                </div>
                           </div>
                           </div>
					<script type="text/javascript">
						$("#deleteitembutton{$index}").click(function(){
							$(this).parent().parent().parent().remove();
							
						})
					</script>
					{/loop}

                            </div>
                          </div>


                          
					</div>
				<div class="panel-footer">
					<a href="javascript:void(0)" onclick="additem()" style="display:block;text-align:center;text-decoration:none;">添加(留空项不编辑或删除)</a>
				</div>
				</div>


		<div class="panel panel-default">
			<div class="panel-heading">鱼钩设置</div>
			<div class="panel-body">
				<div class="tab-content">
					<div class="tab-pane  active" id="tab_basic_hook">
					{loop $hookarray $index $value}
						<div class="itemcontainer">
				
                      
                        <div class="form-group">
                            <label for="inputPassword3" class="col-sm-2 control-label">图片</label>
                            <div class="col-sm-10">
								{php echo tpl_form_field_image('hookimgurl[]',$value['hookimgurl']);}
								<span class="help-block">建议上传图片分辨率57*1100</span>
                            </div>
                            
                          </div>
                          
						
						
                          <div class="form-group">
                             	<label for="inputPassword3" class="col-sm-2 control-label">下钩积分</label>
                             	<div class="col-sm-10">
                                	<input type="text" name="hookpaypoint[]" value="{$value['hookpaypoint']}" class="form-control">
                                </div>
                           </div>
                         

 
                           <div class="form-group">
                           <label for="inputPassword3" class="col-sm-2 control-label"></label>
                             	<div class="col-sm-10">
                           			<button  type="button" id="deletehookbutton{$index}" class="deleteitembutton btn btn-primary">删除</button>
                                </div>
                           </div>
                           </div>
                           {/loop}
                           </div>
					<script type="text/javascript">
						$("#deletehookbutton{$index}").click(function(){
							$(this).parent().parent().parent().remove();
							
						})
					</script>

                            </div>
                          </div>


                          
					
				<div class="panel-footer">
					<a href="javascript:void(0)" onclick="addhook()" style="display:block;text-align:center;text-decoration:none;">添加(留空项不编辑或删除)</a>

				</div>
				
				
 			<input type="submit" class="btn btn-primary" value="保存"/>
	</form>
	<script type="text/javascript">
		var addtime = parseInt({$fisharraylength});
		function additem(){
			
			addtime = addtime+1;
			$("#tab_basic").append('<div class="itemcontainer"><div class="form-group"  style="margin-top:60px;"><label for="inputPassword3" class="col-sm-2 control-label">名称</label><div class="col-sm-10"><input type="text" name="fishname[]" class="form-control"></div></div><div class="form-group"><label for="inputPassword3" class="col-sm-2 control-label">图片</label><div class="col-sm-10"><div class="input-group"><input type="text" name="fishimgurl[]" value="" class="form-control" autocomplete="off"> <span class="input-group-btn"><button class="btn btn-default" type="button" onclick="showImageDialog(this)">选择图片</button></span></div><div class="input-group" style="margin-top:.5em"><img src="./resource/images/nopic.jpg" onerror="this.src=&quot;./resource/images/nopic.jpg&quot;,this.title=&quot;图片未找到.&quot;" class="img-responsive img-thumbnail" width="150"> <em class="close" style="position:absolute;top:0;right:-14px" title="删除这张图片" onclick="deleteImage(this)">×</em></div><span class="help-block">建议上传图片分辨率在240*30到480*84之间</span></div></div><div class="form-group"><label for="inputPassword3"class="col-sm-2 control-label">捕获积分倍数范围（如：0.2-2.0）</label><div class="col-sm-10"><input type="text"name="fishchance[]"class="form-control"></div></div><div class="form-group"><label for="inputPassword3"class="col-sm-2 control-label">捕获积分</label><div class="col-sm-10"><input type="text"name="fishpoint[]"class="form-control"></div></div><div class="form-group"><label for="inputPassword3" class="col-sm-2 control-label"></label><div class="col-sm-10"><button  type="button" id="deleteitembutton'+addtime+'" class="deleteitembutton btn btn-primary">删除</button></div></div></div>');
			$("#deleteitembutton"+addtime).click(function(){
				$(this).parent().parent().parent().remove();
				
			})
		}
		var addhooktime = 0;
		function addhook(){
					
			addhooktime = addhooktime+1;
			$("#tab_basic_hook").append('<div class="itemcontainer"><div class="form-group"><label for="inputPassword3"class="col-sm-2 control-label">图片</label><div class="col-sm-10"><div class="input-group "><input type="text"name="hookimgurl[]"value=""class="form-control"autocomplete="off"><span class="input-group-btn"><button class="btn btn-default"type="button"onclick="showImageDialog(this);">选择图片</button></span></div><div class="input-group "style="margin-top:.5em;"><img src="./resource/images/nopic.jpg"onerror="this.src="./resource/images/nopic.jpg"; this.title="图片未找到.""class="img-responsive img-thumbnail"width="150"><em class="close"style="position:absolute; top: 0px; right: -14px;"title="删除这张图片"onclick="deleteImage(this)">×</em></div><span class="help-block">建议上传图片分辨率57*1100</span></div></div><div class="form-group"><label for="inputPassword3"class="col-sm-2 control-label">下钩积分</label><div class="col-sm-10"><input type="text"name="hookpaypoint[]"class="form-control"></div></div><div class="form-group"><label for="inputPassword3"class="col-sm-2 control-label"></label><div class="col-sm-10"><button type="button"id="deletehookbutton'+addhooktime+'" class="deleteitembutton btn btn-primary">删除</button></div></div></div>');
			$("#deletehookbutton"+addhooktime).click(function(){
				$(this).parent().parent().parent().remove();
				
			})
		}
	</script>
{template 'common/footer'}